Function Reference

_FileCountLines

Returns the number of lines in the specified file.

#include <File.au3>
_FileCountLines( $sFilePath )

 

Parameters

$sFilePath Path and filename of the file to be read

 

Return Value

Success: Returns number of lines in the file.
Failure: Returns a 0
@Error: 0 = No error.
1 = File cannot be opened or found.

 

Remarks

It does not count a final @LF as a line.

 

Related

None.

 

Example


#include <file.au3>
$CountLines = _FileCountLines("error.log")
MsgBox(64, "Error log recordcount", "There are " & $CountLines & " in the error.log.")
Exit